home *** CD-ROM | disk | FTP | other *** search
- ##############################################################################
- # $Id: vtclib.tcl,v 1.5 1997/05/05 03:49:20 stewart Exp $
- #
- # vtclib.tcl - procedures shared by Visual Tcl and apps it generates
- #
- # Copyright (C) 1996-1997 Stewart Allen
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ##############################################################################
- #
-
- proc Window {args} {
- global vTcl
- set cmd [lindex $args 0]
- set name [lindex $args 1]
- set newname [lindex $args 2]
- set rest [lrange $args 3 end]
- if {$name == "" || $cmd == ""} {return}
- if {$newname == ""} {
- set newname $name
- }
- set exists [winfo exists $newname]
- switch $cmd {
- show {
- if {$exists == "1" && $name != "."} {wm deiconify $name; return}
- if {[info procs vTclWindow(pre)$name] != ""} {
- eval "vTclWindow(pre)$name $newname $rest"
- }
- if {[info procs vTclWindow$name] != ""} {
- eval "vTclWindow$name $newname $rest"
- }
- if {[info procs vTclWindow(post)$name] != ""} {
- eval "vTclWindow(post)$name $newname $rest"
- }
- }
- hide { if $exists {wm withdraw $newname; return} }
- iconify { if $exists {wm iconify $newname; return} }
- destroy { if $exists {destroy $newname; return} }
- }
- }
-
-